<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
use app\common\CommonResponse;

function  uuid()
{
    $chars = md5(uniqid(mt_rand(), true));
    $uuid = substr ( $chars, 0, 8 ) . '-'
        . substr ( $chars, 8, 4 ) . '-'
        . substr ( $chars, 12, 4 ) . '-'
        . substr ( $chars, 16, 4 ) . '-'
        . substr ( $chars, 20, 12 );
    return $uuid ;
}


//发送审核完成提醒
function send_notice_sms($phone){
    $smsConfig=config('sms_config');
    $res = file_get_contents("http://api.smsbao.com/sms?u=" . $smsConfig['username'] . "&p=" . md5($smsConfig['password']) . "&m=" .$phone . "&c=" ."【职称网】你的职称审评已完成，请登录系统查看");
    if(!$res==0){
        return false;
    }
    return true;
}

function sysConfig($name){
    return \think\Db::name("config")->where("name",$name)->value("value");
}
